using System;
using System.Collections.Generic;
using System.Text;
using FluentNHibernate.Mapping;
using Water.Model;

namespace Water.Data.Repositories.Mappings
{


    public class MeterReadingMap : ClassMap<MeterReading>
    {
        public MeterReadingMap()
        {
            Table("Tbt_MeterReading");
            Id(x => x.MRNO).GeneratedBy.Assigned().Column("MRNO");
            Map(x => x.EpcNO).Column("EpcNO").Not.Nullable();
            References<Meter>(x => x.Mt, "EpcNO").PropertyRef("EpcNO").Not.Nullable().ReadOnly();
            Map(x => x.MeterDt).Column("MeterDt").Not.Nullable();
            Map(x => x.CopyCode).Column("CopyCode").Not.Nullable();
            Map(x => x.WaterCon).Column("WaterCon").Not.Nullable();
            Map(x => x.Memo).Column("Memo");
            Map(x => x.MeterEmp).Column("MeterEmp").Not.Nullable();
            Map(x => x.CreateDt).Column("CreateDt").ReadOnly();
        }
    }
}
